<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>

*{margin:0; padding:0;}
img{width:100%;}
#bgaudio{width:100%;}
</style>
</head>
<body>
<a class="musicA"><img src="../../www/Public/Special/Img/Reunion/play.png"/></a>
<audio id="bgaudio" src="../../www/Public/Special/Img/Reunion/music1.mp3" autoplay="autoplay" loop ></audio>

<script src="../../www/Public/Web/Js/jquery-1.10.2.min.js"></script>
<script src="../../www/Public/Special/Js/Reunion/jquery.rotate.min.js" type="text/javascript" charset="utf-8"></script>
<script>
var bl=false;
window.onload = function(){
	beginRotate()
}
var playMusic=function(musicSrc){
 	var audio = document.getElementById("bgaudio"); 
		 audio.src = musicSrc;
		 if(bl==true){
		 	audio.play();
			beginRotate()
			bl=false;
		 }else{
		    audio.pause();
			stopRotate()
			bl=true;
	     }
}
$(".musicA").on('click',musicControl)
function musicControl(e){
	parent.firstFlag=true;
	playMusic('../../www/Public/Special/Img/Reunion/music1.mp3');
	e.preventDefault();
}	
/**************旋转******************/
var angle = 0;
var rotateInterval;
function beginRotate(){
	rotateInterval=setInterval(function(){
		  angle+=1;
		 $(".musicA img").rotate(angle);
	},50);
}
function stopRotate(){
	angle = 0;
	$(".musicA img").rotate(angle);
	clearInterval(rotateInterval)
}
</script>
</body>
</html>
